<?php

namespace app\common\model;

use think\Model;

class User extends Model
{
    public function Branch()
    {
        return $this->hasOne('branch', 'id', 'branch_id', 'b', 'LEFT')
            ->setEagerlyType(0)
            ->bind([
                'branch_num' => 'num'
            ]);
    }

    public function Role()
    {
        return $this->hasOne('role', 'id', 'roles', 'r', 'LEFT')
            ->setEagerlyType(0)
            ->bind([
                'role_name' => 'name'
            ]);
    }
}
